-------------------------------------------------------------------------------------
-- -*- coding: utf-8 -*-
--
-- @author:   admin
-- @email:    88888@qq.com
-- @date:     2022-06-30
-- @module:   login_res
-- @describe: 登陆模块用到的资源
-- @version:  v1.0
--
local game_unit = game_unit
-------------------------------------------------------------------------------------
-- 登陆模块资源
---@class login_res
local login_res = {
    -- 创建角色后下线[0关闭  1开启]
    END_GAME_OFTER_CREATE        = 0,
    -- 可创建角色职业
    CAN_CREATE_JOB               = {
        ['战士'] = false,
        ['剑客'] = false,
        ['猎人'] = true,
        ['法师'] = true
    },
    -- 启动页面
    STATUS_INTRO_PAGE            = 0x00, -- 进入游戏时的启动页面
    STATUS_LOGO_PAGE             = 0x01, -- 游戏logo页面   0x02
    STATUS_DOWNLOAD_PAGE         = 0x04, -- 游戏下载更新页面
    STATUS_RESERVED1             = 0x08, -- 预留状态1
    STATUS_RESERVED2             = 0x10, -- 预留状态2

    -- 登陆页面
    STATUS_LOGIN_PAGE            = 0x20,   -- 登陆页面
    STATUS_ACCOUNT_LOGIN_PAGE    = 0x40,   -- 帐号密码登陆页面
    STATUS_THIRDPARTY_LOGIN_PAGE = 0x40,   -- 第三方登陆页面(暂定成一个)
    STATUS_GOOGLE_LOGIN_PAGE     = 0x80,   -- Google账号登陆页面
    STATUS_APPLE_LOGIN_PAGE      = 0x100,  -- Apple账号登陆页面
    STATUS_FACEBOOK_LOGIN_PAGE   = 0x200,  -- Facebook账号登陆页面
    STATUS_TERMS_AGREEMENT_PAGE  = 0x400,  -- 服务条款同意页面
    STATUS_SERVER_SELECT_PAGE    = 0x820,  -- 服务器选择页面

    STATUS_RESERVED3             = 0x1020, -- 预留状态3
    STATUS_RESERVED4             = 0x2020, -- 预留状态4

    -- 选择角色
    STATUS_CHARACTER_SELECT      = 0x4000,  -- 角色选择页面
    STATUS_RESERVED5             = 0x8000,  -- 预留状态5
    STATUS_RESERVED6             = 0x10000, -- 预留状态6
    STATUS_SELECT_JOB            = 0x8020,  -- 选择职业页面
    STATUS_TEST_CHARACTER        = 0x40020, -- 角色测试页面
    STATUS_SELECT_OUTLINE        = 0x10020, -- 角色外形选择
    STATUS_CREATE_NAME           = 0x20020, -- 角色创建名字
    STATUS_SELECT_ROLE           = 0x4020,  -- 选择角色

    -- 创建角色
    STATUS_CREATE_CHARACTER      = 0x20000, -- 创建角色页面
    STATUS_RESERVED7             = 0x40000, -- 预留状态7
    STATUS_RESERVED8             = 0x80000, -- 预留状态8

    -- 游戏里面
    STATUS_IN_GAME               = 0x100000, -- 进入游戏内部状态
    STATUS_PASS_DIALOG           = 0x200000, -- 过场景状态
    STATUS_RESERVED9             = 0x400000, -- 预留状态9
    STATUS_RESERVED10            = 0x800000, -- 预留状态10

    -- 服务器小区对应的后缀名
    BRAN_LIS                     = { 'Knight', 'Bishop', 'Rook' },
    -- 服务器列表
    SER_LIST                     = {
        ['ASIA1'] = {
            'EAST101', 'EAST102', 'EAST103', 'EAST104',
            'SEA101', 'SEA102', 'SEA103', 'SEA104', 'SEA105', 'SEA106', 'SEA107', 'SEA108', 'SEA109',
        },
        ['ASIA2'] = {
            'SEA201', 'SEA202', 'SEA203', 'SEA204', 'SEA205', 'SEA206', 'SEA207',
            'EAST201', 'EAST202', 'EAST203', 'EAST204'
        },
        ['ASIA3'] = {
            'SEA301',
            'EAST301',
        },
    },
    -- 服务器对应大区
    SERVER_REGION                = {
        ['弗丽嘉'] = '一大区',
        ['巴德尔'] = '一大区',
        ['赫尔莫德'] = '一大区',
        ['海姆达尔'] = '二大区',
        ['提尔'] = '二大区',
        ['伊登'] = '二大区',
        ['芙蕾雅'] = '三大区',
        ['密米尔'] = '三大区',
        ['西芙'] = '三大区',
        ['维达尔'] = '四大区',
        ['瓦尔基里'] = '四大区',
        ['苏尔特'] = '四大区',
        ['西格鲁德'] = '五大区',
        ['布伦希尔德'] = '五大区',
        ['格尔德'] = '五大区',
        ['安得瓦利'] = '六大区',
        ['阿斯劳格'] = '六大区',
        ['克瓦希尔'] = '六大区',
        ['摩迪'] = '七大区',
        ['瓦尔'] = '七大区',
        ['法尔康'] = '七大区',
        ['辛德里'] = '八大区',
        ['伊瓦尔迪'] = '八大区',
        ['布洛克'] = '八大区',
        ['尼德霍格'] = '九大区',
        ['斯科尔'] = '九大区',
        ['拉塔托斯克'] = '九大区',
        ['穆格'] = '十三大区',
        ['哈蒂'] = '十三大区',

    },
    -- 服务器转换资源
    SERVER_TABLE = {

        ['韩服大区_弗丽嘉'] = '이그드라실_프리그',
        ['韩服大区_巴德尔'] = '이그드라실_발두르',
        ['韩服大区_赫尔莫德'] = '이그드라실_헤르모드',

        ['韩服大区_海姆达尔'] = '발할라_헤임달',
        ['韩服大区_提尔'] = '발할라_티르',
        ['韩服大区_伊登'] = '발할라_이둔',

        ['韩服大区_芙蕾雅'] = '비프로스트_프레이야',
        ['韩服大区_密米尔'] = '비프로스트_미미르',
        ['韩服大区_西芙'] = '비프로스트_시프',

        ['韩服大区_维达尔'] = '나스트론드_비다르',
        ['韩服大区_瓦尔基里'] = '나스트론드_발키리',
        ['韩服大区_苏尔特'] = '나스트론드_수르트',

        ['韩服大区_西格鲁德'] = '아스가르드_시구르드',
        ['韩服大区_布伦希尔德'] = '아스가르드_브륀힐드',
        ['韩服大区_格尔德'] = '아스가르드_게르드',

        ['韩服大区_安得瓦利'] = '발할라_안드바리',
        ['韩服大区_阿斯劳格'] = '발할라_아슬라우그',
        ['韩服大区_克瓦希尔'] = '발할라_크바시르',

        ['韩服大区_摩迪'] = '발할라_모디',
        ['韩服大区_瓦尔'] = '발할라_바르',
        ['韩服大区_法尔康'] = '발할라_팔케',

        ['韩服大区_辛德里'] = '발할라_에이트리',
        ['韩服大区_伊瓦尔迪'] = '발할라_이발디',
        ['韩服大区_布洛克'] = '발할라_브록',

        ['韩服大区_尼德霍格'] = '발할라_니드호그',
        ['韩服大区_斯科尔'] = '발할라_스콜',
        ['韩服大区_拉塔托斯克'] = '발할라_라타토스크',

        ['韩服大区_穆格'] = '발할라_마니',
        ['韩服大区_哈蒂'] = '발할라_하티',

    }
}


local this = login_res

-------------------------------------------------------------------------------------
-- 是否为可创建的职业
login_res.can_create_job = function(job_name)
    return this.CAN_CREATE_JOB[job_name]
end

-------------------------------------------------------------------------------------
-- 转换服务器名称
login_res.translate_server = function(server_name)
    return this.SERVER_TABLE[server_name]
    --return server_name --this.SERVER_TABLE[server_name]
end

-------------------------------------------------------------------------------------
-- 服务器对应大区名称
function login_res.get_server_region_name(server_name)
    server_name = server_name or main_ctx:c_server_name()
    return this.SERVER_REGION[server_name]
end

-------------------------------------------------------------------------------------
-- 是否在过图中
login_res.is_loading_map = function()
    return game_unit.get_game_status_ex() == this.STATUS_PASS_DIALOG
end

-------------------------------------------------------------------------------------
-- 返回对象
return login_res

-------------------------------------------------------------------------------------
